package com.team11.server.controller.student;


import com.team11.server.pojo.student.P_G_M_Kc_information;
import com.team11.server.pojo.student.P_S_Kc_information;
import com.team11.server.pojo.student.StudentGroupScore;
import com.team11.server.service.impl.SInformationServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dk
 * @since 2021-07-06
 */
@RestController
@CrossOrigin
@RequestMapping("/p-information")
@Api(tags = "学生接口")
public class StudentPInformationController {
    @Resource
    private SInformationServiceImpl sInformationService;
    @GetMapping("/groupList/{sNumber}")
    @ApiOperation(value = "获取项目组成员")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "学生学号",name="sNumber")
    })
    public Object getProjectGroupList(@PathVariable String sNumber){
        return sInformationService.getGroupList(sNumber);
    }

    @GetMapping("/scoreList/{sNumber}")
    @ApiOperation(value = "获取项目组得分和个人得分")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "学生学号",name="sNumber")
    })
    public Object getProjectScoreList(@PathVariable String sNumber){
        return sInformationService.getScoreList(sNumber);
    }
    @GetMapping("/rowNumList/{kcName}")
    @ApiOperation(value = "获取项目组排名榜")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "项目名称",name = "kcName")
    })
    public List<StudentGroupScore> getGroupRowNumList(@PathVariable String kcName){
        return sInformationService.getRowNumList(kcName);
    }
}
